#ifndef MENU_H
#define MENU_H

#include <vector>
#include <fstream>

#include "books.h"
#include "members.h"
#include "borrow.h"

class Menu
{
	public:
	Menu(){};
	virtual ~Menu(){};
	
	void Welcome();
	void Run();
	
	void Read(bool &sx, Books* &dx, std::ifstream &x);	
	void Read(bool &sx, LibMember* &dx, std::ifstream &x);
	void Read(bool &sx, Borrow* &dx, std::ifstream &x);
	
	int StringtoInt(const std::string& s);
	bool StringtoBool(const std::string& s);
	std::string InttoString(const int& number);
	
	protected:
	template<typename T>
	void Save(std::vector<T*> &,std::string&);
	
	template<typename T>
	void Load(T* &,std::vector<T*> &, std::string&);

	int GetInteger(const std::string) const;
	
	private:
	void Help() const;
	void MenuWrite() const;
	

};

#endif
